new: use .{git,hg}ignore syntax that's also understood by Mercurial
authorTshepang Lekhonkhobe <tshepang@gmail.com>
Thu, 29 Jan 2015 17:41:53 +0000 (19:41 +0200)
committerTshepang Lekhonkhobe <tshepang@gmail.com>
Thu, 29 Jan 2015 17:41:53 +0000 (19:41 +0200)
src/cargo/ops/cargo_new.rs

index 63e2e45aa7691387de0089e7e525da37b3c5bfcd..ab7c1c8d92602ea06f99e2a602f9a26760da02b2 100644 (file)
@@ -64,10 +64,10 @@ fn existing_vcs_repo(path: &Path) -> bool {
 fn mk(config: &Config, path: &Path, name: &str,
       opts: &NewOptions) -> CargoResult<()> {
     let cfg = try!(global_config(config));
-    let mut ignore = "/target\n".to_string();
+    let mut ignore = "target\n".to_string();
     let in_existing_vcs_repo = existing_vcs_repo(&path.dir_path());
     if !opts.bin {
-        ignore.push_str("/Cargo.lock\n");
+        ignore.push_str("Cargo.lock\n");
     }
 
     let vcs = match (opts.version_control, cfg.version_control, in_existing_vcs_repo) {